<template>
  <div id="baseInfo" v-if="proData.length">
    <div class="productImg">
      <img
        :src="`${baseURL}/jd_card/goods/good1/${proData[0].bigimg}`"
        alt=""
      />
    </div>
    <div class="productPrice">
      <span class="sp-price">￥{{ proData[0].gprice }}</span>
      <span class="sp-fav"> 收藏 </span>
      <span class="sp-cheaper"> 降价提醒 </span>
    </div>
    <div class="productName">
      <h1>
        <i>
          <img :src="`${baseURL}/jd_card/tubiao/zy.png`" alt="" />
        </i>
        {{ proData[0].gtitle }}
      </h1>
      <div class="desc">
        <p>
          员工夏季清凉福利，中秋商务馈赠选京东E卡，企业团购热线400-656-0055（请在京东商城官方渠道购买京东E卡，谨防上当受骗）详情
        </p>
      </div>
    </div>
    <div class="sku van-hairline--top" @click="$emit('select-sku')">
      <div class="sku-left">
        <span>已选</span>

        <span>￥{{ proData[0].gprice }}</span>
      </div>
      <div class="sku-right">
        <van-icon name="ellipsis" />
      </div>
    </div>
    <div class="addrArea van-hairline--top" @click="$emit('select-area')">
      <div class="add-left">
        <span>送至</span>
        <span>{{ addName }}</span>
        <p>
          <span>现货</span><span>23:00前下单，预计</span
          ><span>明天(07月21日)</span>
        </p>
      </div>
      <div class="add-right">
        <van-icon name="ellipsis" />
      </div>
    </div>
    <div class="weight">
      <div class="weight-left">
        <span>重量</span>
        <span>0.014kg</span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    addName: {
      type: String,
      
    },
    proData:{
      type:Array,
      default(){
        return []
      }
    }
  },
  data() {
    return {
      
    };
  },
};
</script>
<style lang="scss" scoped>
#baseInfo {
  .productImg {
    img {
      width: 100%;
    }
  }
  .productPrice {
    padding: 0 1.125rem;
    margin-top: 0.75rem;
    .sp-price {
      color: #f2270c;
      font-size: 1.875rem;
      font-weight: bold;
      line-height: 1.875rem;
    }
    .sp-cheaper {
      float: right;
      position: relative;
      padding-top: 1.38rem;
      line-height: 1em;
      height: 0.63rem;
      font-size: 0.56rem;
      color: #262626;
      text-align: center;
    }
    .sp-cheaper::after {
      content: "";
      position: absolute;
      top: 0;
      width: 1.13rem;
      height: 1.13rem;
      left: 50%;
      transform: translate(-50%);
      background: url("../../../public/images/tubiao/cheaper.png");
      background-size: 100%;
      border: none;
    }
    .sp-fav {
      float: right;
      position: relative;
      padding-top: 1.38rem;
      line-height: 1em;
      height: 0.63rem;
      width: 2.5rem;
      font-size: 0.56rem;
      color: #262626;
      text-align: center;
    }
    .sp-fav::after {
      content: "";
      position: absolute;
      top: 0;
      width: 1.13rem;
      height: 1.13rem;
      left: 50%;
      transform: translate(-50%);
      background: url("/images/tubiao/fav.png");
      background-size: 100%;
      border: none;
    }
  }
  .productName {
    padding: 0.75rem 1.13rem;
    position: relative;
    i {
      img {
        height: 1.31rem;
      }
    }
    h1 {
      font-weight: 700;
      line-height: 1.31rem;
      padding-right: 0;
      font-size: 1rem;
    }
    .desc {
      width: 100%;
      p {
        font-size: 0.75rem;
      }
    }
  }
  .sku {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.13rem;
    &-left {
      :nth-child(1) {
        font-size: 1rem;
        font-weight: bold;
        padding-right: 10px;
      }
      :nth-child(2) {
        font-size: 0.81rem;
        font-weight: normal;
      }
    }
  }
  .addrArea {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.13rem;
    .add-left {
      > span:nth-child(1) {
        font-size: 16px;
        font-weight: bold;
        padding-right: 10px;
      }
      > span:nth-child(2) {
        font-size: 13px;
        font-weight: normal;
      }
      p {
        margin: 0;
        padding-left: 42px;
        > span:nth-child(1) {
          color: red;
          font-size: 12px;
        }
        span {
          color: #999;
          font-size: 12px;
        }
      }
    }
  }
  .weight {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.13rem;
    .weight-left {
      :nth-child(1) {
        font-size: 1rem;
        font-weight: bold;
        padding-right: 10px;
      }
      :nth-child(2) {
        font-size: 13px;
        font-weight: normal;
      }
    }
  }
}
</style>